package com.example.demo.task;


import com.example.demo.entity.Dakamingxi;
import com.example.demo.service.DakamingxiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.text.ParseException;
import java.util.List;

import static com.example.demo.util.DateUtil.timeStamp;



@Component
@Async
public class ScheduledService {
    @Autowired
    DaKaServiceTaskl daKaServiceTaskl;
    @Autowired
    DakamingxiService dakamingxiService;
   //@Scheduled(cron = "59 59 11,23 * * ?")
   //@Scheduled(cron = "0 0 */1 * * ?")
  // @Scheduled(cron = "0  */1  *  *  *  ?")
   // @Scheduled(fixedDelay  = 20000)
    public void scheduled(){
        String timeStamp = timeStamp();//当前时间戳
       try {
           List<Dakamingxi> list = daKaServiceTaskl.getLogList(timeStamp);
       } catch (ParseException e) {
           e.printStackTrace();
       }
   }

}


